<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}DHCP代理管理系统{% endblock %}</title>
    
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Bootstrap Icons -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css">
    <!-- 自定义样式 -->
    <style>
        :root {
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --success-color: #27ae60;
            --warning-color: #f39c12;
            --danger-color: #e74c3c;
        }
        
        .sidebar {
            background: linear-gradient(135deg, var(--secondary-color), #34495e);
            color: white;
            min-height: 100vh;
            box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        }
        
        .sidebar .nav-link {
            color: #ecf0f1;
            padding: 12px 20px;
            margin: 2px 0;
            border-radius: 8px;
            transition: all 0.3s ease;
        }
        
        .sidebar .nav-link:hover {
            background-color: rgba(255,255,255,0.1);
            color: white;
        }
        
        .sidebar .nav-link.active {
            background-color: var(--primary-color);
            color: white;
        }
        
        .stat-card {
            border-radius: 12px;
            border: none;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            transition: transform 0.2s ease;
        }
        
        .stat-card:hover {
            transform: translateY(-2px);
        }
        
        .stat-card .card-body {
            padding: 1.5rem;
        }
        
        .stat-icon {
            font-size: 2rem;
            opacity: 0.8;
        }
        
        .client-status {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-right: 8px;
        }
        
        .status-online { background-color: var(--success-color); }
        .status-offline { background-color: var(--danger-color); }
        .status-pending { background-color: var(--warning-color); }
        
        .log-level-info { color: var(--primary-color); }
        .log-level-warning { color: var(--warning-color); }
        .log-level-error { color: var(--danger-color); }
        .log-level-debug { color: #95a5a6; }
        
        .progress-thin {
            height: 6px;
        }
        
        @media (max-width: 768px) {
            .sidebar {
                min-height: auto;
            }
        }
    </style>
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <!-- 侧边栏 -->
            <div class="col-lg-2 col-md-3 sidebar p-0">
                <div class="p-3">
                    <h4 class="text-center mb-4">
                        <i class="bi bi-hdd-network"></i>
                        DHCP代理
                    </h4>
                    
                    <ul class="nav flex-column">
                        <li class="nav-item">
                            <a class="nav-link {% if request.path == '/' %}active{% endif %}" href="/">
                                <i class="bi bi-speedometer2 me-2"></i>
                                仪表板
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {% if request.path == '/clients' %}active{% endif %}" href="/clients">
                                <i class="bi bi-pc-display me-2"></i>
                                客户端管理
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {% if request.path == '/dns' %}active{% endif %}" href="/dns">
                                <i class="bi bi-globe me-2"></i>
                                DNS管理
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {% if request.path == '/network' %}active{% endif %}" href="/network">
                                <i class="bi bi-diagram-3 me-2"></i>
                                网络监控
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {% if request.path == '/logs' %}active{% endif %}" href="/logs">
                                <i class="bi bi-journal-text me-2"></i>
                                系统日志
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {% if request.path == '/settings' %}active{% endif %}" href="/settings">
                                <i class="bi bi-gear me-2"></i>
                                系统设置
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
            
            <!-- 主内容区 -->
            <div class="col-lg-10 col-md-9 ms-sm-auto px-4 py-3">
                {% block content %}{% endblock %}
            </div>
        </div>
    </div>

    <!-- Bootstrap JS -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <!-- Chart.js -->
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    
    {% block scripts %}{% endblock %}
</body>
</html>
